package com.sy.simpleegg.mvp.presenter

import androidx.lifecycle.LifecycleCoroutineScope
import com.sy.simpleegg.base.BasePresenter
import com.sy.simpleegg.mvp.contract.RecordContract
import com.sy.simpleegg.mvp.model.RecordModel
import kotlinx.coroutines.launch

class RecordPresenter(private val lifecycleCoroutineScope: LifecycleCoroutineScope): BasePresenter<RecordContract.Model, RecordContract.View>(), RecordContract.Presenter {

    override fun createModel(): RecordContract.Model = RecordModel()
    override fun getOrder(date: String) {
        lifecycleCoroutineScope.launch {
            mView?.loadData(mModel?.getOrder(date)?: mutableListOf())
        }
    }


}